/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.spielo.crystaldesigner.property;

import java.io.File;
import java.util.HashMap;

/**
 *
 * @author Bernhard
 *
 * This class saves properties for the whole project, e.g. the path to the
 * extracted path folder Properties: name: packageProperties; value: properties
 * of the package
 */
public class PropertyHolder {

    private static PropertyHolder instance;
    private HashMap<String, Object> properties = new HashMap<>();

    private PropertyHolder() {

    }

    public static PropertyHolder getInstance() {
        if (instance == null) {
            instance = new PropertyHolder();
        }

        return instance;
    }

    public void addProperty(String key, Object property) {
        properties.put(key, property);
    }

    public Object getProperty(String key) {
        return properties.get(key);
    }

    public void deleteProperty(String key) {
        if (properties.containsKey(key)) {
            properties.remove(key);
        }
    }
}
